/**
 * 
 */
package de.cbf.cam.dsa.model.entities.states.stateChanger;

import java.util.Iterator;
import java.util.List;

import de.cbf.cam.dsa.model.entities.BattleChar;
import de.cbf.cam.dsa.model.entities.OneAction;
import de.cbf.cam.dsa.model.entities.OneNPC;
import de.cbf.cam.dsa.model.entities.constants.ActionConstants;

/**
 * @author Nebelritter
 *
 */
public class StateChangerINI extends StateChangerBase {
	/**
	 * @uml.property  name="value"
	 */
	private int value;
	
//========================
//		constructors
//========================
	public StateChangerINI(int value) {
		super();
		this.value = value;
	}

//========================
//	   public methods
//========================

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.entities.states.stateChanger.StateChangerBase#changeState(de.cbf.cam.dsa.model.entities.OneNPC)
	 */
	@Override
	public void changeState(OneNPC character) {
	}


	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.entities.states.stateChanger.StateChangerBase#changeStateBattle(de.cbf.cam.dsa.model.entities.BattleChar)
	 */
	@Override
	public void changeStateBattle(BattleChar character) {
		List<OneAction> activeActions = character.getTypedActions(ActionConstants.ATTACK_ACTION);
		for (Iterator<OneAction> iterator = activeActions.iterator(); iterator.hasNext();) {
			OneAction action = (OneAction) iterator.next();
			action.setIni(action.getIni()+value);
		}
	}

	/**
	 * @return
	 * @uml.property  name="value"
	 */
	public int getValue() {
		return value;
	}

	/**
	 * @param value
	 * @uml.property  name="value"
	 */
	public void setValue(int value) {
		this.value = value;
	}

//========================
//    standard methods
//========================

//========================
// 	   private methods
//========================

//========================
// 	SHORT property access
//========================

//========================
//		getters
//========================

//========================
//		setters
//========================

//========================
//		listeners
//========================

}
